package cn.com.css.taxInspection.gt3.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.com.css.taxInspection.gt3.mapper.JcAjztTjZxwbDlMapper;
import cn.com.css.taxInspection.gt3.entity.JcAjztTjZxwbDlEntity;
import cn.com.css.taxInspection.gt3.entity.JcAjztTjZxwbEntity;
import cn.com.css.taxInspection.gt3.service.JcAjztTjZxwbDlService;
import cn.com.css.taxInspection.util.TsBqUtils;


@Service("jcAjztTjZxwbDlService")
public class JcAjztTjZxwbDlServiceImpl extends ServiceImpl<JcAjztTjZxwbDlMapper, JcAjztTjZxwbDlEntity> implements JcAjztTjZxwbDlService {
	@Override
	@DS("oracle")
	public IPage<JcAjztTjZxwbDlEntity> infoPage(JcAjztTjZxwbEntity jcAjztTjZxwbEntity) {
		Page page = new Page(jcAjztTjZxwbEntity.getPage(), jcAjztTjZxwbEntity.getLimit());
		LambdaQueryWrapper<JcAjztTjZxwbDlEntity> queryWrapper = Wrappers.lambdaQuery();
		
		if(TsBqUtils.isNotNull(jcAjztTjZxwbEntity.getJcry())){
			queryWrapper.like(JcAjztTjZxwbDlEntity::getJcry, jcAjztTjZxwbEntity.getJcry());
		}
		if(TsBqUtils.isNotNull(jcAjztTjZxwbEntity.getNd())){
			queryWrapper.eq(JcAjztTjZxwbDlEntity::getNd, jcAjztTjZxwbEntity.getNd());
		}
		if(TsBqUtils.isNotNull(jcAjztTjZxwbEntity.getSwjgDm())){
			queryWrapper.eq(JcAjztTjZxwbDlEntity::getSwjgDm, jcAjztTjZxwbEntity.getSwjgDm());
		}
		
		
		IPage<JcAjztTjZxwbDlEntity> iPage = this.page(page, queryWrapper);
		
		return iPage;
		
	}

}